<template src="./index.html"></template>

<script>
import appointmentRecordService from "../../../../_services/appointmentRecord.service";
export default {
  name: "TianDingPatientMeAppointmentRecordComponent",
  data() {
    return {
      user: {},
      selected: "-1",
      appointmentRecordList: []
    };
  },
  mounted() {
    this.user = JSON.parse(this.local$.getItem("tdUser"));
    this.GetAppointmentRecordList();
  },
  methods: {
    GetAppointmentRecordList() {
      this.indicator$.open("正在加载...");
      this.appointmentRecordList = [];
      let params = {};
      params.pageIndex = 1;
      params.pageSize = 100;
      if (this.selected !== "-1") {
        params.OrderStatus = parseInt(this.selected);
      }
      params.orderby = "CreateTime";
      params.isDesc = true;
      params.userID = this.user.UserID;
      appointmentRecordService
        .GetAppointmentRecordList(params)
        .then(response => {
          if (response && response.Data.Items.length > 0) {
            this.appointmentRecordList = response.Data.Items;
          }
          this.indicator$.close();
        });
    }
  }
};
</script>
